#include "../func.h"

int main()
{
    int fd;
    fd=open("file", O_RDWR);
    if (-1 == fd)
    {
        perror("open");
        return -1;
    }
    char* p;
    p = (char*)mmap(NULL, 5, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
    if (p == (char*)-1)
    {
        perror("mmap");
        return -1;
    }

    p[0] = 'H';
    int ret = munmap(p, 5);
    if(ret != 0)
    {
        perror("munmap");
        return -1;
    }
    return 0;
}
